<?php
include "FormGenerator.php";
$username = "mysql_user";
$password = "mysql_pass";
$host = "localhost";
$db = "database";
$tb = "table";
$submitText = "Display";
if((isset($_GET["db"]) && $_GET["db"] != "") && (isset($_GET["tb"]) && $_GET["tb"] !="")) {
		$db = $_GET["db"];
		$tb = $_GET["tb"];
} else if((isset($_POST["db"]) && $_POST["db"] != "") && (isset($_POST["tb"]) && $_POST["tb"] !="")) {
		$db = $_POST["db"];
		$tb = $_POST["tb"];
}
$form = new FormGenerator($username,$password,$host,$db,$tb,$submitText);
$form->handleUploads();
if(!$form->isSubmitted()) {
   $form->generateForm("::self",false);
} else {
   $push = false;
   if(isset($_POST["push"]) && $_POST["push"]) {
      $push = true;
   }
   $form->execute(true);
   $form->pushToDB();
}
?>

